﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarolLib.Extension
{
    public static class ObjectExtension
    {
        public static string SerializerToXml(this object obj)
        {
            if (obj == null)
                return null;
            return XmlSerializeHelper.ConvertToString(obj);
        }

        public static string SerializerToJson(this object obj)
        {
            if (obj == null)
                return null;
            return JsonSerializeHelper.DataContractJsonSerialize(obj);
        }
    }
}
